package com.huan.thread;

import java.util.concurrent.TimeUnit;

public class TestThread {
    public static void main(String[] args) throws InterruptedException {
        ThreadA threadA = new ThreadA();


        new Thread(() -> {
            System.out.println("thread1等待了");
            threadA.wait0();
            System.out.println("thread1唤醒了");
        }
        ).start();
        new Thread(() -> {
            System.out.println("thread2等待了");
            threadA.wait0();
            System.out.println("thread2唤醒了");
        }
        ).start();
        new Thread(() -> {
            System.out.println("thread3等待了");
            threadA.wait0();
            System.out.println("thread3唤醒了");
        }
        ).start();

        TimeUnit.SECONDS.sleep(3);
        threadA.notifyAll0();


    }
}
